﻿using Camc.Quality.Bop.Dto;
using Camc.Quality.Chat.Exporting;
using Camc.Quality.DataExporting.Excel.EpPlus;
using Camc.Quality.Dto;
using Camc.Quality.Dto.QualityPlatformDto;
using Camc.Quality.Dto.TableDto.RbopDto;
using Camc.Quality.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Camc.Quality.Bop
{
    public class BopQualityExportAppService : EpPlusExcelExporterBase
    {
        private readonly ITempFileCacheManager _tempFileCacheManager;

        public BopQualityExportAppService(ITempFileCacheManager tempFileCacheManager) : base(tempFileCacheManager)
        {
            _tempFileCacheManager = tempFileCacheManager;
        }
        /// <summary>
        /// 导出Excel
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string QualityExportToFile(PQualitWorkStepDto data, bool envelope,bool isFt, string nodeName)
        {
            var processesExplain = System.DateTime.Now.ToString("yyyyMMdd");
            return CreateExcelPackageLocal(
                $"{nodeName+processesExplain}.xlsx",
                excelPackage =>
                {
                    if (data.WorkStepOut.InsertDetails != null)
                    {
                        if (data.WorkStepOut.InsertDetails.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "insertDetails").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "insertDetails").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( 
                                isFt,
                          sheet, 2, data.WorkStepOut.InsertDetails,
                            _ => _.Code,
                            _ => _.Name,
                            _ => _.Number,
                            _ => _.Remark,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ManufacturingResources != null)
                    {
                        if (data.WorkStepOut.ManufacturingResources.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "manufacturingResources").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "manufacturingResources").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( 
                                isFt,
                          sheet, 2, data.WorkStepOut.ManufacturingResources,
                            _ => _.Type,
                            _ => _.ErpId,
                            _ => _.SpecsCode,
                            _ => _.Name,
                            _ => _.Remark,
                            _ => _.IdentifyType,
                            _ => _.StandardNumber,
                            _ => _.IsRequired,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.Video != null)
                    {
                        if (data.WorkStepOut.Video.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "video").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "video").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Video,
                            _ => _.VideoFile,
                            _ => _.FileName,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.Assemble != null)
                    {
                        if (data.WorkStepOut.Assemble.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "assemble").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "assemble").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Assemble,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.GeneralRecords != null)
                    {
                        if (data.WorkStepOut.GeneralRecords.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "generalRecords").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "generalRecords").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.GeneralRecords,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.GlueSolution != null)
                    {
                        if (data.WorkStepOut.GlueSolution.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "glueSolution").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "glueSolution").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.GlueSolution,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordItem,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Hatch != null)
                    {
                        if (data.WorkStepOut.Hatch.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "hatch").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "hatch").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Hatch,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.RecordLocation,
                            _ => _.RecordItem,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route

                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InCabin != null)
                    {
                        if (data.WorkStepOut.InCabin.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "inCabin").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "inCabin").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InCabin,
                            _ => _.SerialNum,
                            _ => _.Model,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordStatus,
                            _ => _.Remarks,
                            _ => _.RecordRequire,
                            _ => _.RecordMainopoint,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.MainParts != null)
                    {
                        if (data.WorkStepOut.MainParts.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "mainParts").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "mainParts").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.MainParts,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.SecondDrawingNum,
                            _ => _.Certificate,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Moment != null)
                    {
                        if (data.WorkStepOut.Moment.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "moment").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "moment").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Moment,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.MultimediaRecord != null)
                    {
                        if (data.WorkStepOut.MultimediaRecord.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "multimediaRecord").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "multimediaRecord").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.MultimediaRecord,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordRequire,
                            _ => _.PhotoNo,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.TorqueReCalibration != null)
                    {
                        if (data.WorkStepOut.TorqueReCalibration.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "torqueReCalibration").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "torqueReCalibration").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.TorqueReCalibration,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.ProcessorDemand,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.QualityControl != null)
                    {
                        if (data.WorkStepOut.QualityControl.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "qualityControl").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "qualityControl").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.QualityControl,
                            _ => _.SerialNum,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn3 = sheet.Column(3);
                            timeColumn3.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn5 = sheet.Column(5);
                            timeColumn5.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CablePlugWaterFireProofControl != null)
                    {
                        if (data.WorkStepOut.CablePlugWaterFireProofControl.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "cablePlugWaterFireProofControl").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "cablePlugWaterFireProofControl").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CablePlugWaterFireProofControl,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.BellowsDeformation != null)
                    {
                        if (data.WorkStepOut.BellowsDeformation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "bellowsDeformation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "bellowsDeformation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.BellowsDeformation,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FisrtDrawingNum,
                            _ => _.ProductNum,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn17 = sheet.Column(17);
                            timeColumn17.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ElectricalConnectInsertion != null)
                    {
                        if (data.WorkStepOut.ElectricalConnectInsertion.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "electricalConnectInsertion").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "electricalConnectInsertion").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ElectricalConnectInsertion,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.PhotoNo,
                            _ => _.SecondPhotoNo,
                            _ => _.ThirdPhotoNo,
                            _ => _.FourthPhotoNo,
                            _ => _.FirstOperator,
                            _ => _.SecondOperator,
                            _ => _.ThirdOperator,
                            _ => _.FourthOperator,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.HatchOpenShutTest != null)
                    {
                        if (data.WorkStepOut.HatchOpenShutTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "hatchOpenShutTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "hatchOpenShutTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.HatchOpenShutTest,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.FirstDrawingName,
                            _ => _.RecordLocation,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ProductGroundingStatus != null)
                    {
                        if (data.WorkStepOut.ProductGroundingStatus.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "productGroundingStatus").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "productGroundingStatus").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ProductGroundingStatus,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ForcedCheckpoint != null)
                    {
                        if (data.WorkStepOut.ForcedCheckpoint.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "forcedCheckpoint").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "forcedCheckpoint").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ForcedCheckpoint,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.FourthOperator,
                            _ => _.FourthOperatorData,
                            _ => _.FifthOperator,
                            _ => _.FifthOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.AutomaticShutoff != null)
                    {
                        if (data.WorkStepOut.AutomaticShutoff.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "automaticShutoff").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "automaticShutoff").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.AutomaticShutoff,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordItem,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Servomechanism != null)
                    {
                        if (data.WorkStepOut.Servomechanism.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "servomechanism").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "servomechanism").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Servomechanism,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.FirstDrawingName,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.StatusCheck != null)
                    {
                        if (data.WorkStepOut.StatusCheck.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "statusCheck").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "statusCheck").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.StatusCheck,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.FirstConfirmResult,
                            _ => _.RecordRequire,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ProblemRecord != null)
                    {
                        if (data.WorkStepOut.ProblemRecord.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "problemRecord").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "problemRecord").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ProblemRecord,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.AbnormalRecord,
                            _ => _.MeasuredActual,
                            _ => _.PhotoNo,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.DetonatingCableSize != null)
                    {
                        if (data.WorkStepOut.DetonatingCableSize.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "detonatingCableSize").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "detonatingCableSize").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.DetonatingCableSize,
                            _ => _.SerialNum,
                            _ => _.ThirdMeasuredValues,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ReleaseSpringCompression != null)
                    {
                        if (data.WorkStepOut.ReleaseSpringCompression.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "releaseSpringCompression").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "releaseSpringCompression").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ReleaseSpringCompression,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordLocation,
                            _ => _.ProductNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.LoadBracket != null)
                    {
                        if (data.WorkStepOut.LoadBracket.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "loadBracket").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "loadBracket").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LoadBracket,
                            _ => _.SerialNum,
                            _ => _.RecordItem,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.DesignGeneralAssemble != null)
                    {
                        if (data.WorkStepOut.DesignGeneralAssemble.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "designGeneralAssemble").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "designGeneralAssemble").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.DesignGeneralAssemble,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.FourthOperator,
                            _ => _.FourthOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn18 = sheet.Column(18);
                            timeColumn18.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.SoapBubble != null)
                    {
                        if (data.WorkStepOut.SoapBubble.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "soapBubble").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "soapBubble").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.SoapBubble,
                            _ => _.SerialNum,
                            _ => _.ParentProductNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.RecordRequire,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.HeliumMassSpectrometry != null)
                    {
                        if (data.WorkStepOut.HeliumMassSpectrometry.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "heliumMassSpectrometry").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "heliumMassSpectrometry").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.HeliumMassSpectrometry,
                            _ => _.SerialNum,
                            _ => _.ParentProductNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.RecordRequire,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.AtmPressure,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.FinalAssemblyParts != null)
                    {
                        if (data.WorkStepOut.FinalAssemblyParts.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "finalAssemblyParts").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "finalAssemblyParts").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.FinalAssemblyParts,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.SecondDrawingNum,
                            _ => _.ParentProductName,
                            _ => _.RecordMainopoint,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.SensorInstallation != null)
                    {
                        if (data.WorkStepOut.SensorInstallation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "sensorInstallation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "sensorInstallation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.SensorInstallation,
                            _ => _.SerialNum,
                            _ => _.ParentProductNum,
                            _ => _.ParentProductName,
                            _ => _.RecordStatus,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordLocation,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordItem,
                            _ => _.RecordMainopoint,
                            _ => _.ProcessorDemand,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.SecondToolUsed,
                            _ => _.ThirdToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn22 = sheet.Column(22);
                            timeColumn22.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn24 = sheet.Column(24);
                            timeColumn24.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn26 = sheet.Column(26);
                            timeColumn26.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.PlugStatus != null)
                    {
                        if (data.WorkStepOut.PlugStatus.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "plugStatus").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "plugStatus").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.PlugStatus,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordStatus,
                            _ => _.RecordRequire,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.FirstIMUInstallation != null)
                    {
                        if (data.WorkStepOut.FirstIMUInstallation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "firstIMUInstallation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "firstIMUInstallation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.FirstIMUInstallation,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.SecondIMUInstallation != null)
                    {
                        if (data.WorkStepOut.SecondIMUInstallation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "secondIMUInstallation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "secondIMUInstallation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.SecondIMUInstallation,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordItem,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CableHeight != null)
                    {
                        if (data.WorkStepOut.CableHeight.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "cableHeight").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "cableHeight").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CableHeight,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.LowCrimpingExperiment != null)
                    {
                        if (data.WorkStepOut.LowCrimpingExperiment.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "lowCrimpingExperiment").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "lowCrimpingExperiment").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LowCrimpingExperiment,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordItem,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.LowFrequencyCableStripping != null)
                    {
                        if (data.WorkStepOut.LowFrequencyCableStripping.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "lowFrequencyCableStripping").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "lowFrequencyCableStripping").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LowFrequencyCableStripping,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.ToolUsed,
                            _ => _.SecondToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.HighFrequencyCableStripping != null)
                    {
                        if (data.WorkStepOut.HighFrequencyCableStripping.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "highFrequencyCableStripping").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "highFrequencyCableStripping").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.HighFrequencyCableStripping,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordItem,
                            _ => _.SecondMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.SecondToolUsed,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstrumentCheck != null)
                    {
                        if (data.WorkStepOut.InstrumentCheck.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "instrumentCheck").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "instrumentCheck").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstrumentCheck,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.FirstConfirmResult,
                            _ => _.SecondConfirmResult,
                            _ => _.ThirdConfirmResult,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CableReceivingInspection != null)
                    {
                        if (data.WorkStepOut.CableReceivingInspection.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "cableReceivingInspection").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "cableReceivingInspection").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CableReceivingInspection,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstConfirmResult,
                            _ => _.SecondConfirmResult,
                            _ => _.ThirdConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ArrowInterfaceProtectCheck != null)
                    {
                        if (data.WorkStepOut.ArrowInterfaceProtectCheck.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "arrowInterfaceProtectCheck").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "arrowInterfaceProtectCheck").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ArrowInterfaceProtectCheck,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.RecordMainopoint,
                            _ => _.RecordRequire,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InspectionRecord != null)
                    {
                        if (data.WorkStepOut.InspectionRecord.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "inspectionRecord").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "inspectionRecord").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InspectionRecord,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordLocation,
                            _ => _.RecordItem,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.DockSurfaceMorpheme != null)
                    {
                        if (data.WorkStepOut.DockSurfaceMorpheme.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "dockSurfaceMorpheme").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "dockSurfaceMorpheme").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.DockSurfaceMorpheme,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordElement,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.FilingFileRepair != null)
                    {
                        if (data.WorkStepOut.FilingFileRepair.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "filingFileRepair").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "filingFileRepair").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.FilingFileRepair,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.MeasuredActual,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.CheckFairingAfterInstallation != null)
                    {
                        if (data.WorkStepOut.CheckFairingAfterInstallation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "checkFairingAfterInstallation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "checkFairingAfterInstallation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CheckFairingAfterInstallation,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.FirstConfirmResult,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Catheterization != null)
                    {
                        if (data.WorkStepOut.Catheterization.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "catheterization").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "catheterization").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Catheterization,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.MeasuredActual,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.FourthOperator,
                            _ => _.FourthOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.BlowPipeArrow != null)
                    {
                        if (data.WorkStepOut.BlowPipeArrow.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "blowPipeArrow").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "blowPipeArrow").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.BlowPipeArrow,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.GasPipeTest != null)
                    {
                        if (data.WorkStepOut.GasPipeTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "gasPipeTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "gasPipeTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.GasPipeTest,
                            _ => _.SerialNum,
                            _ => _.ProcessorDemand,
                            _ => _.RecordRequire,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn17 = sheet.Column(17);
                            timeColumn17.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ValvesGasInspection != null)
                    {
                        if (data.WorkStepOut.ValvesGasInspection.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "valvesGasInspection").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "valvesGasInspection").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ValvesGasInspection,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.RecordStatus,
                            _ => _.RecordElement,
                            _ => _.FirstConfirmResult,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstallationLocation != null)
                    {
                        if (data.WorkStepOut.InstallationLocation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "installationLocation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "installationLocation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstallationLocation,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.ProductNum,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstallationDistance != null)
                    {
                        if (data.WorkStepOut.InstallationDistance.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "installationDistance").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "installationDistance").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstallationDistance,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.RecordLocation,
                            _ => _.RecordRequire,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.MeasurementSpacingConduit != null)
                    {
                        if (data.WorkStepOut.MeasurementSpacingConduit.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "measurementSpacingConduit").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "measurementSpacingConduit").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.MeasurementSpacingConduit,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordMainopoint,
                            _ => _.FirstMeasuredValues,
                            _ => _.PhotoNo,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.FailureAequiredLoosInsurance != null)
                    {
                        if (data.WorkStepOut.FailureAequiredLoosInsurance.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "failureAequiredLoosInsurance").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "failureAequiredLoosInsurance").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.FailureAequiredLoosInsurance,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.RecordLocation,
                            _ => _.RecordMainopoint,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.DisassemblyReassembly != null)
                    {
                        if (data.WorkStepOut.DisassemblyReassembly.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "disassemblyReassembly").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "disassemblyReassembly").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.DisassemblyReassembly,
                            _ => _.SerialNum,
                            _ => _.RecordMainopoint,
                            _ => _.RecordRequire,
                            _ => _.FisrtDrawingNum,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Insulation703 != null)
                    {
                        if (data.WorkStepOut.Insulation703.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "insulation703").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "insulation703").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Insulation703,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.ParentProductName,
                            _ => _.RecordMainopoint,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.AdiabaticRemoval != null)
                    {
                        if (data.WorkStepOut.AdiabaticRemoval.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "adiabaticRemoval").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "adiabaticRemoval").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.AdiabaticRemoval,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordRequire,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CalibrationContinuousTorque != null)
                    {
                        if (data.WorkStepOut.CalibrationContinuousTorque.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "calibrationContinuousTorque").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "calibrationContinuousTorque").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CalibrationContinuousTorque,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.ProcessorDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondDrawingNum,
                            _ => _.DesignerDemand,
                            _ => _.SecondMeasuredValues,
                            _ => _.RecordLocation,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstallationPipeCushion != null)
                    {
                        if (data.WorkStepOut.InstallationPipeCushion.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "installationPipeCushion").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "installationPipeCushion").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstallationPipeCushion,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.MeasuredActual,
                            _ => _.RecordMainopoint,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ArrowStructureWaterproof != null)
                    {
                        if (data.WorkStepOut.ArrowStructureWaterproof.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "arrowStructureWaterproof").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "arrowStructureWaterproof").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ArrowStructureWaterproof,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.ParentProductName,
                            _ => _.FisrtDrawingNum,
                            _ => _.DesignerDemand,
                            _ => _.FirstConfirmResult,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.WaterproofInstallationLapd != null)
                    {
                        if (data.WorkStepOut.WaterproofInstallationLapd.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "waterproofInstallationLapd").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "waterproofInstallationLapd").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.WaterproofInstallationLapd,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ArrowScalageProducts != null)
                    {
                        if (data.WorkStepOut.ArrowScalageProducts.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "arrowScalageProducts").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "arrowScalageProducts").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ArrowScalageProducts,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ArrowWeight != null)
                    {
                        if (data.WorkStepOut.ArrowWeight.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "arrowWeight").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "arrowWeight").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ArrowWeight,
                            _ => _.SerialNum,
                            _ => _.ParentProductName,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordStatus,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.Assemnleweighing != null)
                    {
                        if (data.WorkStepOut.Assemnleweighing.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "assemnleweighing").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "assemnleweighing").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.Assemnleweighing,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ConfirmationStatus != null)
                    {
                        if (data.WorkStepOut.ConfirmationStatus.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "confirmationStatus").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "confirmationStatus").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ConfirmationStatus,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.ProductNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.FirstConfirmResult,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.CorrespondingRelationship != null)
                    {
                        if (data.WorkStepOut.CorrespondingRelationship.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "correspondingRelationship").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "correspondingRelationship").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CorrespondingRelationship,
                            _ => _.SerialNum,
                            _ => _.ParentProductNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordStatus,
                            _ => _.ParentProductName,
                            _ => _.SecondDrawingNum,
                            _ => _.RecordRequire,
                            _ => _.RecordMainopoint,
                            _ => _.FirstConfirmResult,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CrimpingSealedPlug != null)
                    {
                        if (data.WorkStepOut.CrimpingSealedPlug.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "crimpingSealedPlug").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "crimpingSealedPlug").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CrimpingSealedPlug,
                            _ => _.SerialNum,
                            _ => _.ParentProductNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.RecordMainopoint,
                            _ => _.PhotoNo,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.FourthOperator,
                            _ => _.FourthOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CylinderGroup != null)
                    {
                        if (data.WorkStepOut.CylinderGroup.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "cylinderGroup").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "cylinderGroup").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CylinderGroup,
                            _ => _.SerialNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.DesignerDemand,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.CylinderPressureTest != null)
                    {
                        if (data.WorkStepOut.CylinderPressureTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "cylinderPressureTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "cylinderPressureTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.CylinderPressureTest,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.DesiccantInspection != null)
                    {
                        if (data.WorkStepOut.DesiccantInspection.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "desiccantInspection").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "desiccantInspection").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.DesiccantInspection,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.MeasuredActual,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn6 = sheet.Column(6);
                            timeColumn6.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ExperimentalCrimping != null)
                    {
                        if (data.WorkStepOut.ExperimentalCrimping.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "experimentalCrimping").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "experimentalCrimping").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ExperimentalCrimping,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordStatus,
                            _ => _.SecondMeasuredValues,
                            _ => _.RecordMainopoint,
                            _ => _.ThirdMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.SecondToolUsed,
                            _ => _.ThirdToolUsed,
                            _ => _.RecordItem,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn18 = sheet.Column(18);
                            timeColumn18.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.FlightMassCentroidTareWeight != null)
                    {
                        if (data.WorkStepOut.FlightMassCentroidTareWeight.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "flightMassCentroidTareWeight").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "flightMassCentroidTareWeight").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.FlightMassCentroidTareWeight,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.RecordItem,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.GasSealFlowTest != null)
                    {
                        if (data.WorkStepOut.GasSealFlowTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "gasSealFlowTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "gasSealFlowTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.GasSealFlowTest,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.GeneralWeighing != null)
                    {
                        if (data.WorkStepOut.GeneralWeighing.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "generalWeighing").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "generalWeighing").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.GeneralWeighing,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.HighFrequencyVoltage != null)
                    {
                        if (data.WorkStepOut.HighFrequencyVoltage.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "highFrequencyVoltage").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "highFrequencyVoltage").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.HighFrequencyVoltage,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordStatus,
                            _ => _.SecondMeasuredValues,
                            _ => _.RecordMainopoint,
                            _ => _.ThirdMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.SecondToolUsed,
                            _ => _.ThirdToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn17 = sheet.Column(17);
                            timeColumn17.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstallationQuantity != null)
                    {
                        if (data.WorkStepOut.InstallationQuantity.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "installationQuantity").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "installationQuantity").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstallationQuantity,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn5 = sheet.Column(5);
                            timeColumn5.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InterfaceCheck != null)
                    {
                        if (data.WorkStepOut.InterfaceCheck.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "interfaceCheck").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "interfaceCheck").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InterfaceCheck,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordLocation,
                            _ => _.FirstConfirmResult,
                            _ => _.MeasuredActual,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.JobDivision != null)
                    {
                        if (data.WorkStepOut.JobDivision.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "jobDivision").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "jobDivision").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.JobDivision,
                            _ => _.SerialNum,
                            _ => _.FirstMeasuredValues,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.FourthOperator,
                            _ => _.FourthOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn5 = sheet.Column(5);
                            timeColumn5.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.LargePartsDelivery != null)
                    {
                        if (data.WorkStepOut.LargePartsDelivery.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "largePartsDelivery").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "largePartsDelivery").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LargePartsDelivery,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.DesignerDemand,
                            _ => _.FirstConfirmResult,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.LevelingDataFlight != null)
                    {
                        if (data.WorkStepOut.LevelingDataFlight.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "levelingDataFlight").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "levelingDataFlight").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LevelingDataFlight,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.LiquidLevelSensor != null)
                    {
                        if (data.WorkStepOut.LiquidLevelSensor.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "liquidLevelSensor").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "liquidLevelSensor").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LiquidLevelSensor,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ProductInstallationConfirmation != null)
                    {
                        if (data.WorkStepOut.ProductInstallationConfirmation.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "productInstallationConfirmation").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "productInstallationConfirmation").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ProductInstallationConfirmation,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.ProcessorDemand,
                            _ => _.MeasuredActual,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ProtectiveParts != null)
                    {
                        if (data.WorkStepOut.ProtectiveParts.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "protectiveParts").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "protectiveParts").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ProtectiveParts,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordStatus,
                            _ => _.RecordRequire,
                            _ => _.RecordLocation,
                            _ => _.FirstConfirmResult,
                            _ => _.MeasuredActual,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.QuadrantCheck != null)
                    {
                        if (data.WorkStepOut.QuadrantCheck.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "quadrantCheck").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "quadrantCheck").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.QuadrantCheck,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordRequire,
                            _ => _.FirstConfirmResult,
                            _ => _.Remarks,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ReceivingInspectionRecord != null)
                    {
                        if (data.WorkStepOut.ReceivingInspectionRecord.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "receivingInspectionRecord").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "receivingInspectionRecord").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ReceivingInspectionRecord,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.MeasuredActual,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn7 = sheet.Column(7);
                            timeColumn7.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.SystemPressureMaintaining != null)
                    {
                        if (data.WorkStepOut.SystemPressureMaintaining.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "systemPressureMaintaining").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "systemPressureMaintaining").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.SystemPressureMaintaining,
                            _ => _.SerialNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordStatus,
                            _ => _.DesignerDemand,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordRequire,
                            _ => _.SecondMeasuredValues,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.ToolUsed,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.TailCoverSolenoid != null)
                    {
                        if (data.WorkStepOut.TailCoverSolenoid.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "tailCoverSolenoid").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "tailCoverSolenoid").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.TailCoverSolenoid,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.RecordRequire,
                            _ => _.RecordLocation,
                            _ => _.FirstConfirmResult,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.TensileStrengthHigh != null)
                    {
                        if (data.WorkStepOut.TensileStrengthHigh.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "tensileStrengthHigh").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "tensileStrengthHigh").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.TensileStrengthHigh,
                            _ => _.SerialNum,
                            _ => _.RecordRequire,
                            _ => _.FirstMeasuredValues,
                            _ => _.RecordStatus,
                            _ => _.SecondMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.TransverseCentroid != null)
                    {
                        if (data.WorkStepOut.TransverseCentroid.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "transverseCentroid").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "transverseCentroid").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.TransverseCentroid,
                            _ => _.SerialNum,
                            _ => _.RecordLocation,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.ThirdMeasuredValues,
                            _ => _.FourthMeasuredValues,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                        }
                    }
                    if (data.WorkStepOut.ValveTest != null)
                    {
                        if (data.WorkStepOut.ValveTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "valveTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "valveTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ValveTest,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.ProductNum,
                            _ => _.RecordStatus,
                            _ => _.FirstMeasuredValues,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn17 = sheet.Column(17);
                            timeColumn17.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ValveTestSec != null)
                    {
                        if (data.WorkStepOut.ValveTestSec.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "valveTestSec").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "valveTestSec").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ValveTestSec,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.RecordElement,
                            _ => _.RecordRequire,
                            _ => _.ProductNum,
                            _ => _.RecordStatus,
                            _ => _.FirstMeasuredValues,
                            _ => _.SecondMeasuredValues,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.Remarks,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn18 = sheet.Column(18);
                            timeColumn18.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.ValveUsageTimes != null)
                    {
                        if (data.WorkStepOut.ValveUsageTimes.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "valveUsageTimes").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "valveUsageTimes").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.ValveUsageTimes,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.ProductNum,
                            _ => _.DesignerDemand,
                            _ => _.RecordStatus,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.LargeSectionWeight != null)
                    {
                        if (data.WorkStepOut.LargeSectionWeight.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "largeSectionWeight").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "largeSectionWeight").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.LargeSectionWeight,
                            _ => _.SerialNum,
                            _ => _.RecordElement,
                            _ => _.FirstMeasuredValues,
                            _ => _.ToolUsed,
                            _ => _.Temperature,
                            _ => _.Humidity,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn8 = sheet.Column(8);
                            timeColumn8.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn10 = sheet.Column(10);
                            timeColumn10.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.MultimediaElectricalConnect != null)
                    {
                        if (data.WorkStepOut.MultimediaElectricalConnect.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "multimediaElectricalConnect").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "multimediaElectricalConnect").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.MultimediaElectricalConnect,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.PhotoNo,
                            _ => _.SecondPhotoNo,
                            _ => _.ThirdPhotoNo,
                            _ => _.FourthPhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn15 = sheet.Column(15);
                            timeColumn15.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstrumentCableAllowance != null)
                    {
                        if (data.WorkStepOut.InstrumentCableAllowance.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "instrumentCableAllowance").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "instrumentCableAllowance").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstrumentCableAllowance,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.FirstMeasuredValues,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstrumentSeparationCable != null)
                    {
                        if (data.WorkStepOut.InstrumentSeparationCable.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "instrumentSeparationCable").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "instrumentSeparationCable").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstrumentSeparationCable,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.FirstMeasuredValues,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstrumentSeparationForceTest != null)
                    {
                        if (data.WorkStepOut.InstrumentSeparationForceTest.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "instrumentSeparationForceTest").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "instrumentSeparationForceTest").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstrumentSeparationForceTest,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.FirstMeasuredValues,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.InstrumentTorqueRecord != null)
                    {
                        if (data.WorkStepOut.InstrumentTorqueRecord.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "instrumentTorqueRecord").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "instrumentTorqueRecord").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.InstrumentTorqueRecord,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.ToolUsed,
                            _ => _.DesignerDemand,
                            _ => _.ProcessorDemand,
                            _ => _.Remarks,
                            _ => _.FirstMeasuredValues,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark, _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn12 = sheet.Column(12);
                            timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn14 = sheet.Column(14);
                            timeColumn14.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn16 = sheet.Column(16);
                            timeColumn16.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                    if (data.WorkStepOut.MultimediaSheetSocket != null)
                    {
                        if (data.WorkStepOut.MultimediaSheetSocket.Count > 0)
                        {
                            var sheetName = data.TableNameDictionary.Where(d => d.TableKey == "multimediaSheetSocket").First().TableName;
                            var tableHeader = data.TableNameDictionary.Where(d => d.TableKey == "multimediaSheetSocket").First().FiledName;
                            var sheet = excelPackage.Workbook.Worksheets.Add(L(sheetName));
                            sheet.OutLineApplyStyle = true;
                            AddHeader(sheet, tableHeader.ToArray());
                            AddQualityObjectsNew( isFt,
                          sheet, 2, data.WorkStepOut.MultimediaSheetSocket,
                            _ => _.SerialNum,
                            _ => _.FisrtDrawingNum,
                            _ => _.FirstDrawingName,
                            _ => _.ProductNum,
                            _ => _.ParamCode,
                            _ => _.FirstMeasuredValues,
                            _ => _.PhotoNo,
                            _ => _.FirstOperator,
                            _ => _.FirstOperatorData,
                            _ => _.SecondOperator,
                            _ => _.SecondOperatorData,
                            _ => _.ThirdOperator,
                            _ => _.ThirdOperatorData,
                            _ => _.RecordRemark,
                            _ => _.Route
                          );
                            for (var i = 1; i <= tableHeader.Count; i++)
                            {
                                //sheet.Column(i).AutoFit();
                            }
                            var timeColumn9 = sheet.Column(9);
                            timeColumn9.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn11 = sheet.Column(11);
                            timeColumn11.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                            var timeColumn13 = sheet.Column(13);
                            timeColumn13.Style.Numberformat.Format = "yyyy - mm - dd hh: mm:ss";
                        }
                    }
                });

        }


        public string KeyWorkExportToFile(List<KeyWorkOutput>  data)
        {
            var processesExplain = System.DateTime.Now.ToString("yyyyMMddHHmm");
            return CreateExcelPackageLocal(
                $"重点工作报表{processesExplain}.xlsx",
                excelPackage =>
                {
                    var sheet = excelPackage.Workbook.Worksheets.Add(L("重点工作统计"));
                    var tableHeader = new string[] { "规程编号","规程名称", "工序号", "工序名称", "工序属性", "工步号", "工步属性", "工步完成日期", "查看路径" };
                    sheet.OutLineApplyStyle = true;
                    AddHeader(sheet, tableHeader.ToArray());
                            
                    AddObjects(
                        sheet, 2, data,
                        _ => _.TechniqueNumber,
                        _ => _.TechniqueName,
                        _ => _.ProcessesSequenceDesc,
                        _ => _.ProcessesName,
                        _ => _.ProcessesCharacteristic,
                        _ => _.WorkStepNumberDesc,
                        _ => _.WorkStepCharacteristic,
                        _ => _.ThirdOperatorData,
                        _ => _.Route
                    );
                    for (var i = 1; i <= tableHeader.Count(); i++)
                    {
                        sheet.Column(i).AutoFit();
                    }
                    var timeColumn12 = sheet.Column(8);
                    timeColumn12.Style.Numberformat.Format = "yyyy - mm - dd ";

                });
    }

    }
}
